fstats_distributions Module



Variables

Type Visibility Attributes Name Initial
real(kind=real64), public, parameter :: distribution_pi = 2.0d0*acos(0.0d0)

Interfaces

interface

  • public pure elemental function distribution_function(this, x) result(rst)

    Defines the interface for a probability distribution function.

    Arguments

    Type IntentOptional Attributes Name
    class(distribution), intent(in) :: this

    The distribution object.

    real(kind=real64), intent(in) :: x

    The value at which to evaluate the function.

    Return Value real(kind=real64)

    The value of the function.

interface

  • public pure function distribution_property(this) result(rst)

    Computes the value of a distribution property.

    Arguments

    Type IntentOptional Attributes Name
    class(distribution), intent(in) :: this

    The distribution object.

    Return Value real(kind=real64)

    The property value.

interface

  • public subroutine distribution_recenter(this, x)

    Recenters the distribution about the supplied value.

    Arguments

    Type IntentOptional Attributes Name
    class(distribution), intent(inout) :: this

    The distribution object.

    real(kind=real64), intent(in) :: x

    The value about which to recenter.

interface

  • public pure function multivariate_distribution_function(this, x) result(rst)

    Defines an interface for a multivariate probability distribution function.

    Arguments

    Type IntentOptional Attributes Name
    class(multivariate_distribution), intent(in) :: this

    The distribution object.

    real(kind=real64), intent(in), dimension(:) :: x

    The values at which to evaluate the function.

    Return Value real(kind=real64)

    The value of the function.


Derived Types

type, public ::  distribution

Defines a probability distribution.

Type-Bound Procedures

procedure(distribution_function), public, deferred, pass :: cdf
procedure, public :: defined_range => dist_defined_range
procedure, public :: log_cdf => dist_log_cdf ..\..\

Natural log of P(X <= x).<\p>

procedure, public :: log_pdf => dist_log_pdf ..\..\

Natural log density (or log probability mass for discrete laws).<\p>

procedure, public :: log_survival => dist_log_survival ..\..\

Natural log of P(X > x).<\p>

procedure(distribution_property), public, deferred, pass :: mean
procedure(distribution_property), public, deferred, pass :: median
procedure(distribution_property), public, deferred, pass :: mode
procedure(distribution_function), public, deferred, pass :: pdf
procedure(distribution_recenter), public, deferred, pass :: recenter
procedure, public :: standardized_variable => dist_std_var
procedure, public :: survival => dist_survival ..\..\

Upper-tail probability P(X > x), evaluated directly for built-ins.<\p>

procedure(distribution_property), public, deferred, pass :: variance

type, public ::  multivariate_distribution

Defines a multivariate probability distribution.

Type-Bound Procedures

procedure, public :: log_pdf => mvd_log_pdf ..\..\

Computes the log density; custom laws should override the PDF fallback.<\p>

procedure(multivariate_distribution_function), public, deferred, pass :: pdf ..\..\

Computes the probability density function.<\p>


Functions

public pure elemental function probability_log(value) result(rst)

Computes a log density or probability with explicit zero handling.

Arguments

Type IntentOptional Attributes Name
real(kind=real64), intent(in) :: value

Nonnegative density or probability.

Return Value real(kind=real64)

Natural logarithm; zero gives -infinity, negative or NaN gives NaN.

public pure elemental function softplus(value) result(rst)

Computes log(1 + exp(value)) without overflowing the exponential.

Arguments

Type IntentOptional Attributes Name
real(kind=real64), intent(in) :: value

Exponent argument.

Return Value real(kind=real64)

Softplus value; NaN inputs propagate.